import server from "../../utils/axios.js";
/**
 * @description 资产数据
 */
export default class AssetA1 {
  constructor() {}
  /**
   * @description 得到资产数据
   */
  static async get(
    search = { str60s: "", pagequery: "" },
    sort = { strorder: "", ordertype: "" }
  ) {
    let result = await server(this.name, "Get", { search, sort });
    return result;
  }
  /**
   * @description 得到资产显示的列
   */
  static async GetSysAssetA2() {
    let result = await server(this.name, "GetSysAssetA2");
    return result;
  }
  /**
   * @description 得到资产修改的列
   */
  static async GetEditForm() {
    let result = await server(this.name, "GetEditForm");
    return result;
  }
  /**
   * @description 得到资产下拉
   */
  static async GetAssetA1Ddl(sysasseta1 = {}, opt = "") {
    let result = await server(this.name, "GetAssetA1Ddl", { sysasseta1, opt });
    return result;
  }
  /**
   * @description 得到资产通过查询条件
   */
  static async GetByQuery(querydata = {}) {
    let result = await server(this.name, "GetByQuery", { querydata });
    return result;
  }
  /**
   * @description 保存资产
   */
  static async Save(data = {}) {
    let result = await server(this.name, "Save", data);
    return result;
  }
  /**
   * @description 保存资产
   */
  static async DeleteA1(ids = []) {
    let result = await server(this.name, "DeleteA1", { ids });
    return result;
  }
  /**
   * @description 拆分资产
   */
  static async AssetCopy(id = "") {
    let result = await server(this.name, "AssetCopy", { id });
    return result;
  }
  /**
   * @description 新增得到最大编号
   */
  static async GetNewAsset() {
    let result = await server(this.name, "GetNewAsset");
    return result;
  }
  /**
   * @description 新增得到最大编号
   */
  static async CheckData(data = [], batch = "") {
    let result = await server(`${this.name}/CheckData`, "GetNewAsset", {
      data,
      batch
    });
    return result;
  }
}
